<?php
/**
 * Created by PhpStorm.
 * User: 刚
 * Date: 2017/7/31
 * Time: 18:38
 */
include_once('PHPBookPrototype.php');
include_once('SQLBookPrototype.php');

define('BR', '<' . 'BR' . '>');

echo 'BEGIN TESTING PROTOTYPE PATTERN' . BR;
echo BR;

$phpProto = new PHPBookPrototype();
$sqlProto = new SQLBookPrototype();

$book1 = clone $sqlProto;
$book1->setTitle('SQL for Cats');
echo 'Book 1 topic:' . $book1->getTopic() . BR;
echo 'Book 1 title:' . $book1->getTitle() . BR;

echo BR;

$book2 = clone $sqlProto;
$book2->setTitle('OReilly Learning PHP7');
echo 'Book 2 topic:' . $book2->getTopic() . BR;
echo 'Book 2 title:' . $book2->getTitle() . BR;

echo BR;

$book3 = clone $sqlProto;
$book3->setTitle('OReilly Learning SQL');
echo 'Book 3 topic:' . $book3->getTopic() . BR;
echo 'Book 3 title:' . $book3->getTitle() . BR;

echo 'END TESTING PROTOTYPE' . BR;

